const insTypeMap = {
  shop: 0, //门店;
  passageway: 1, //出入口
  fitting: 2, //试衣间;
  cashier: 3, //收银台
  good: 4, //商品
  zone: 5 //商品分区
}

class insType {
  constructor(type = 0) {
    this.type = type;
  }
  set type(type) {
    this._type = type;
    this.name = this.setUpName(this._type);
    this.nameKey = this.setNameKey(this._type);
  }
  setUpName(type) {
    switch (type) {
      case insTypeMap.shop:
        return '门店';
      case insTypeMap.passageway:
        return '出入口';
      case insTypeMap.fitting:
        return '试衣间';
      case insTypeMap.cashier:
        return '收银台';
      case insTypeMap.good:
        return '商品';
      case insTypeMap.zone:
        return '商品分区';
      default:
        return '';
    }
  }
  setNameKey(type) {
    switch (type) {
      case insTypeMap.shop:
        return 'shopName';
      case insTypeMap.passageway:
        return 'passagewayName';
      case insTypeMap.fitting:
        return 'fittingName';
      case insTypeMap.cashier:
        return 'cashierName';
      case insTypeMap.good:
        return 'goodsName';
      case insTypeMap.zone:
        return 'zoningName';
      default:
        return '';
    }
  }
}
module.exports = {
  InsType: insType,
  InsTypeMap: insTypeMap
}